//
//  DispatchQueue.swift
//  Edaixi-iOS
//
//  Created by 刘树华 on 2017/12/5.
//  Copyright © 2017年 刘树华. All rights reserved.
//

import Foundation

func doSomethingInMainThread(work: @escaping ()->())  {
    DispatchQueue.main.async(execute: work)
}
func doSomeThingInGolbal(work: @escaping ()->()){
    DispatchQueue.global().async(execute: work)
}
func doSomeThingAfterDelay(inMain:Bool = true , time: TimeInterval = 0  ,work: @escaping ()->() ){
    var queue = DispatchQueue.main
    if !inMain {
        queue = DispatchQueue.global()
    }
    queue.asyncAfter(deadline: DispatchTime.now()+time, execute: work)
    
}
